import App from './App'
import {
  createSSRApp
} from 'vue'
import {
  createI18n
} from 'vue-i18n'

import store from '@/store'
import i18n from '@/i18n'

import env from '@/env.js'
import admin_config from './admin.config.js'
import package_config from '@/package.json'

import mixin from '@/mixin.js'


//注意顺序，api必需再最后面
import "@/interceptor/api.js"


import adminConfig from "@/admin.config.js"


export function createApp() {
  const app = createSSRApp(App)

  app.config.globalProperties.$env = env
  app.config.globalProperties.$package = package_config
  app.config.globalProperties.$adminConfig = adminConfig

  app.use(store)

  app.use(i18n)

  app.mixin(mixin)

  return {
    app
  }
}